/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo.model.util;

import demo.model.dao.ProductDA;
import demo.model.dto.IDataSourceTO;
import demo.model.dto.ProductTO;
import java.util.ArrayList;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Admin
 */
public class Main {
    public static void main(String agr[]){
        try {
            IDataSourceTO idataTO=new IDataSourceTO() {

                @Override
                public String getPassword() {
                    return "123456";
                }

                @Override
                public String getUsername() {
                    return "root";
                }

                @Override
                public String getUrl() {
                    return "jdbc:mysql://localhost:3306/demo";
                }

                @Override
                public String getDriver() {
                    return "com.mysql.jdbc.Driver";
                }
            };
            ProductDA proDA;
            SqlBundle sb=SqlBundle.getInstance();
            sb.buildPath("C:\\Users\\Admin\\Desktop\\Demo\\Demo\\src\\java\\properties");
            proDA = new ProductDA(idataTO, sb);
            ArrayList<ProductTO> l=proDA.getAllProduct();
            ProductTO product=new ProductTO();
            product.setName("");
            System.out.print(l.size());
            
        } catch (Exception ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
